calculateSurcharge
HTTP method: GET
Use the calculateSurcharge method to calculate the surcharge for a new subscription payment, based on a previously completed payment, or a combination of terminal, credit card token, and currency.
Test URL | https://testgateway.altapaysecure.com/merchant/API/<method> |
Production URL | https://<YourShopName>.altapaysecure.com/merchant/API/<method> |
If surcharging is disabled on your terminal, but rules have been set up, the calculateSurcharge method calculates the surcharge based on those rules. As of January 2018, surcharging consumer credit cards in the EU, Norway, and Iceland is prohibited.
Parameter | Description | Type | Notes |
---|---|---|---|
amount | The amount from which to derive the surcharge. | float | If you send the payment_id parameter, you only need to send the amount parameter, not the terminal, currency, or credit_card_token parameters. |
currency | A three letter or 3 digit currency code. ISO-4217 | string | |
terminal | The name of the terminal the payment will be made on. | string | |
credit_card_token | A previously used credit card token from an eCommerce payment or a MO/TO payment. | [0-9a-f]{40} | |
payment_id |
The id of an existing payment or subscription to base the calculation on. |
[0-9a-f]{1,32} |
The table shows the most pertinent response values for the method. For a complete list of API response parameters, see API Response structure (XML).
Parameter | Description | Type |
---|---|---|
<Result> | Success or Fail. | string |
<SurchargeAmount> | The surcharge amount. | float |
GET call
https://<YourShopName>.altapaysecure.com/merchant/API/calculateSurcharge/?amount=12.34&terminal=My terminal&credit_card_token=abcdef1234567890abcdef1234567890¤cy=EUR
XML response
<SurchageAmount> is deprecated and will eventually be removed. Please use <SurchargeAmount> instead.
<?xml version="1.0" encoding="utf-8" ?> <APIResponse version="20170228"> <Header> <Date>2020-09-29T12:34:56+02:00</Date> <Path>API/calculateSurcharge</Path> <ErrorCode>0</ErrorCode> <ErrorMessage></ErrorMessage> </Header> <Body> <Result>Success</Result> <SurchageAmount>12.34</SurchageAmount> <SurchargeAmount>12.34</SurchargeAmount> </Body> </APIResponse>
After you have calculated the surcharge, you can apply it when creating a new payment, for example using the reservation, or chargeSubscription method.